<?php
/**这个方法完成了简单的reids功能，自己增加自己的方法
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/5
 * Time: 13:36
 */

namespace style\lib;

class Redis_class
{
  static $connect = '';

  /**
   * Redis constructor.
   * @param $host 链接地址
   * @param $port 端口
   */
  static function run()
  {
    if (self::$connect) {
      return self::$connect;
    } else {
      $reids_confg = new \app\confg\reids();
      $confg = $reids_confg->get();
      $redis = new \Redis();
      $redis->connect($confg['host'], $confg['port']);
      self::$connect = $redis;
      return $redis;
    }
  }





}